import { IsNotEmpty, Validate } from 'class-validator'
import { isConfirmRule } from 'src/common/rules/is-confirm.rule'
import { isNotExistRule } from 'src/common/rules/is-not-exists.rules'

export class RegisterDto{
    @IsNotEmpty({message:'用户名不能为空'})
    @isNotExistRule('user',{message:'用户名不能重复'})
    name:string
    @IsNotEmpty({message:'密码不能为空'})
    @Validate(isConfirmRule,{message:"两次密码不一致"})
    password:string
    @IsNotEmpty({message:'确认密码不能为空'})
    password_confirm:string
}